export interface PermissionList {
    checkedKeys: string[];
    halfCheckedKeys: string[];
}

export interface IRole {
    _id: string;
    roleName: string;
    createId: number;
    updateTime: string;
    createTime: string;
    __v: number;
    permissionList: PermissionList;
}

export interface RoleListResponse {
    list: IRole[];
    page: {
        pageNum: number;
        pageSize: number;
        total: number;
    };
}

// 简化的角色接口
export interface IRoleSimple {
  _id: string;
  roleName: string;
}

// 添加角色请求参数接口
export interface IAddRoleParams {
  roleName: string;
  remark?: string;
}

// 编辑角色请求参数接口
export interface IEditRoleParams extends IAddRoleParams {
  _id: string;
}



// 权限相关接口
export interface IPermissionResult {
  menuList: IMenu[];
  buttonList: string[];
}

// 菜单项接口
export interface IMenu {
  _id: string;
  menuType: number; // 1: 菜单 2: 按钮
  menuName: string;
  path?: string;
  icon?: string;
  menuCode?: string;
  orderBy: number;
  menuState: number; // 1: 启用 0: 禁用
  parentId: string;
  createId: number;
  createTime: string;
  updateTime: string;
  __v: number;
  children?: IMenu[];
  buttons?: IMenu[];
}

// 权限列表接口
export interface IPermissionList {
  checkedKeys: string[];
  halfCheckedKeys: string[];
}

export interface IPermission{
  _id: string;
  permissionList:IPermissionList
}

// API响应接口
export interface IRoleListResponse {
  list: IRole[];
  page: {
    pageNum: number;
    pageSize: number;
    total: number;
  };
}

// 查询参数接口
export interface IRoleSearchParams {
  roleName?: string;
  pageNum?: number;
  pageSize?: number;
}